package com.ft.f_springboot_route.mapper;


import com.ft.f_springboot_route.bean.Route_Img;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface Route_ImgMapper {

    @Select("select * from route_img where route_id = #{Route_Id} limit #{currentPage},4")
    List<Route_Img> selectlistRoute_Img(Integer Route_Id, Integer currentPage);

    @Select("select count(route_id) from route_img where route_id = #{Route_Id}")
    long selectLong(Integer Route_Id);

    @Select("select * from route_img where img_id = #{img_id}")
    Route_Img selectRoute_Img(Integer img_id);


    @Select("select * from route_img where route_id = #{Route_Id}")
    List<Route_Img> selectlistRoute_ImgAllByid(Integer Route_Id);


    @Insert("insert into route_img value(0,#{routeId},#{imgSrc})")
    void addRoute_Img(Route_Img Route_Img);

    @Delete("delete  from route_img where route_id = #{route_id}")
    void deleRoute_ImgAll(Integer route_id);

    @Delete("delete  from route_img where img_id = #{Route_Img_Id}")
    void dele(Integer Route_Img_Id);

    @Update("update route_img set route_id = #{routeId},img_src = #{imgSrc} where img_id = #{imgId}")
    void edit(Route_Img Route_Img);




}
